package cn.qin.Actions;

import net.sf.json.JSONArray;

import org.apache.struts2.json.annotations.JSON;
import org.json.JSONException;

import cn.qin.Services.newsServices;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class showNewsByCidAction extends ActionSupport {
	int count;
	String c_id;
	newsServices nes=new newsServices();
	JSONArray JSON = new JSONArray();
	
	public String execute(){
		return Action.SUCCESS;
	}
	@JSON(name="news")
	public JSONArray getJSON() throws JSONException {
		return nes.showNewsByCid(this.getCount(),this.getC_id());	
	}
	
	public void setJSON(JSONArray jSON) {
		this.JSON = jSON;
	}
	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public String getC_id() {
		return c_id;
	}

	public void setC_id(String c_id) {
		this.c_id = c_id;
	}

}
